package cs271.hw.liststackqueue;

import cs271.hw.liststackqueue.interfaces.SimpleQueue;

public class SimpleQueueImpl<T> implements SimpleQueue<T> {

	private SinglyLinkedList<T> list = new SinglyLinkedList<T>();
	
	public T dequeue() {
		//return null when called on empty queue 
		if (!isEmpty()){
			T temp = list.get(0);			
			list.remove(0);
			return temp;
		}
			return null;	
	}

	public void enqueue(T item) {
		list.add(item);
	}

	public boolean isEmpty() {
		return list.size() == 0;
	}

	public int size() {
		return list.size();
	}

}
